import pytest

from file.doXlsx import Dofiel
from jiSuanQ.jiSq import Class_j
dof=Dofiel()
f = r'F:\work\codings\python\pro_test\date\yunSuanData.xlsx'
l=dof.doExeRead(f,'jian',2,12,2,5)

class TestMyJian():
    @pytest.mark.parametrize('tou,a,b,yq',l)
    def testMJ(self,tou,a,b,yq):
        cl=Class_j()
        r=cl.myJian(a,b)
        if isinstance(r,float):
            r=round(r,2)
        else:
            if isinstance(r,(int,float)):
                assert r==yq
            elif (a==''or a is None)or (b==''or b is None):
                assert '空' in yq
            else:
                assert '非法' in yq